package io.renren.modules.echarts.controller;

import io.renren.common.utils.R;
import io.renren.modules.echarts.dao.StudentAttendenceECharts;
import io.renren.modules.echarts.service.StudentAttendenceEChartsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;


@RestController
@RequestMapping("/StudentAttendenceCharts")
public class StudentAttendenceEChartsController {
    @Autowired
    StudentAttendenceEChartsService studentAttendanceEchartsService;

    @RequestMapping("/studentAttendance")
    public R studentAttendance(@RequestParam Map<String, Object> params){
        //到课率
        Map  CoincidenceRate=studentAttendanceEchartsService.studentAttendanceRate(params);

        Map<String,List> timeLine=studentAttendanceEchartsService.studentAttendanceRateTimeLine(params);
        return R.ok().put("coincidenceRate",CoincidenceRate).put("timeLine",timeLine);
    }

}
